//生产总览组件(测试阶段)
import React, { Component } from "react";
import { connect } from "dva";
import {Tabs } from "antd-mobile";
import { StickyContainer, Sticky } from "react-sticky";
import styles from "./ProductionOverview.less";

import ProHistory from "./tab/ProHistory";
import ProData from "./tab/ProData";
import ddonfig from '../../ddconfig';
ddonfig.setTitle('生产总览')


//tab切换套件

function renderTabBar(props) {
    return (
        <Sticky>
            {({ style }) => (
                <div style={{ ...style, zIndex: 1 }}>
                    <Tabs.DefaultTabBar {...props} />
                </div>
            )}
        </Sticky>
    );
}
const tabs = [{ title: "实时" }, { title: "历史" }];

class ProductionOverview extends Component {
    state = {
        disabled: false
    };

    production = () => {
        console.log(1);
    };

    render() {
        return (
            <div>
                <div className={styles.wrap}>
                    <div className={styles.typearea}>
                        <div>
                            <StickyContainer>
                                <Tabs
                                    tabs={tabs}
                                    initalPage={"t2"}
                                    renderTabBar={renderTabBar}
                                    tabBarUnderlineStyle={React.CSSProperties}
                                >
                              
                                            <ProData/>
                            

                                    <ProHistory />
                                    
                              
                                </Tabs>
                            </StickyContainer>
                        </div>
                    </div>
                </div>
            </div>
        );
    }
}
function mapStateToProps(state) {
    return {};
}
export default connect()(ProductionOverview);
